;-ask whether executable should be installed in WBStartup or not
(procedure P_WBStartup
(if (exists "SYS:WBStartup")
(set #exeinwbs (askbool
(prompt "\nDo you want to install the MBlank executable\nin your 'WBStartup' drawer?\n\n(WBStartup+ users no worries, see HELP...)")
(help "YES:\nThe installer will copy the executable to your 'WBStartup' drawer. If 'WBStartup (Enabled)' is present, MBlank will be copied there.\n\nNO:\nMBlank executable will be copied to '"#mbpath"'.")
)
)
)
;-if previous answered with YES, set executable path to WBStartup,
;-but if 'WBStartup/WBStartup (Enabled)' exists, adapt
;-alter tooltypes to suit user's needs, experts only
(procedure P_Tooltypes
(
(set #seconds (asknumber
(prompt "\nHow many seconds before blanking?")
(help "Use values between 1 and 2000 seconds.")
(range 1 2000)
(default 180)
)
)
(tooltype
(dest "MBlank.exe")
(settooltype "SECONDS" (cat #seconds))
)
(if (= @user-level 2)
(complete 35)
(complete 55)
)
(if (= (askbool
(prompt "\nDo you want the MBlank window\nto popup at program-startup?")
(help "\nYES:\nMBlank's window will popup when you start the program.\n\nNO:\nMBlank will startup without notification.") ) 1)
(tooltype
(dest "MBlank.exe")
(settooltype "CX_POPUP" "YES")
)
(tooltype
(dest "MBlank.exe")
(settooltype "CX_POPUP" "NO")
)
)
(if (= @user-level 2)
(complete 40)
)
)
(if (= @user-level 2)
(
(if (= (askbool
(prompt "\nDo you want blanking to be reset\nby a mouse-move? (not press!)")
(help "\n No help for experts!") ) 1)
(tooltype
(dest "MBlank.exe")
(settooltype "MOUSETRIG" "YES")
)
(tooltype
(dest "MBlank.exe")
(settooltype "MOUSETRIG" "NO")
)
)
(complete 50)
(if (= (askbool
(prompt "\nDo you want blanking to be reset\nby a disk-insert/removal?")
(help "\n No help for experts!") ) 1)
(tooltype
(dest "MBlank.exe")
(settooltype "DISKTRIG" "YES")
)
(tooltype
(dest "MBlank.exe")
(settooltype "DISKTRIG" "NO")
)
)
(complete 60)
(if (= (askbool
(prompt "\nDo you want MBlank to add a menu-item\nto WorkBench's Tools menu?\n\nPicking this item will activate blanking\nafter a short 'release mouse first' delay.")
(help "\n No help for experts!") ) 1)
(tooltype
(dest "MBlank.exe")
(settooltype "MENU" "YES")
)
(tooltype
(dest "MBlank.exe")
(settooltype "MENU" "NO")
)
)
(complete 70)
(if (= (askbool
(prompt "\nDo you want multiple modules\nto alternate at random?")
(help "\n No help for experts!") ) 1)
(tooltype
(dest "MBlank.exe")
(settooltype "RANDOM" "YES")
)
(tooltype
(dest "MBlank.exe")
(settooltype "RANDOM" "NO")
)
)
)
)
)
;-show the statistics and ask for approval
;-nothing was actually done sofar, so cleanup on abort is not needed
(procedure P_StatCopy
(if (= (askbool
(prompt "\n* The destinations *\n\nFiles: "#mbpath"\nExecutable: "#exepath)
(help "Proceed:\nThis is like it is.\n\nCancel:\nAbort installer now.")
(choices "Proceed" "Cancel") ) 1)
(P_Copy)
(exit "\nReport any problems with this script to:\n\ndamian@cybercomm.nl (subject: MBlank)" (quiet))
)
)
;----------------------------------- Main ------------------------------------
(welcome "\nThis script will install MBlank "#version",\n"#date", damian@cybercomm.nl")
(P_DestPath)
(complete 10)
(P_Exists)
(complete 20)
(P_WBStartup)
(complete 30)
(P_Tooltypes)
(complete 80)
(P_StatCopy)
(complete 90)
(P_Cleanup)
(complete 100)
(exit " \nThank you very much for installing\nMBlank "#version" ("#date") to\n"MBlankDir"\n\nIf you have any problems with the program,\nfeel free to contact me via e-mail.\n\ndamian@cybercomm.nl\nhttp://www.cybercomm.nl/~damian" (quiet))